package com.czbank.financing.mapper;

import com.czbank.financing.Entity.Role;
import org.apache.ibatis.annotations.*;

import javax.annotation.Resource;
import java.util.List;

@Resource(name="indexMapper")
public interface RoleMapper {

    @Select("SELECT * FROM role")
    public List<Role> TotalRole();

    @Select("SELECT * FROM role where id=#{id}")
    public Role selectRoleById(@Param("id") long id);

    @Update("updata role set rid=#{rid},role_name=#{role_name},pid=#{pid},moneyState=#{moneyState},invalidTime=#{invalidTime}")
    int updateRole(@Param("role")Role role);

    @Insert("insert into role(rid,role_name,,pid,moneyState,invalidTime) values(#{rid},#{role_name},#{pid},#{moneyState},#{invalidTime})")
    int addRole(@Param("role")Role role);

    @Delete("delete * FROM role where id=#{id}")
    int deleteRole(@Param("id")long id);
}
